<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title></title>
		<!-- <script src="./js/vconsole.min.js"></script>
		<script>
		// 初始化
		var vConsole = new VConsole();
		console.log('Hello world');
		</script> -->
	</head>
	<body style="padding: 0px;margin: 0px;">
		<div id="app" style="width: 100%;">
			<input @change="filechange" style="width: 1px;height: 1px;position: fixed;left: 0px;top: 0px;z-index: -1;" type="file" id="tfile" />
			<div style="width: 100%;height: 100vh;display: flex;flex-direction: column;align-items: center;justify-content: center;background: #383838;">
				<div onclick="csfileed()" style="width: 180px;height: 60px;display: flex;align-items: center;justify-content: center;border-radius: 10px;background: whitesmoke;">
					<img src="../html/images/csfile.png" style="width: 30px;height: 30px;" alt="" />
					<div style="font-size: 18px;margin-left: 6px;">选择文件</div>
				</div>
			</div>
			
			<div v-if="percent > 0" style="width: 100%;height: 100vh;display: flex;flex-direction: column;align-items: center;justify-content: center;background: rgb(4,7,18);position: fixed;left: 0px;top: 0px;z-index: 99;">
				<img style="width: 100%;" :src="`./images/20241031231353.gif?t=${t}`" alt="" />
				<div style="color: white;margin-top: -30px;">
					{{percent}}%
				</div>
				<div style="color: white;margin-top: 5px;">
					上传中...
				</div>
			</div>
		</div>
	</body>
	<!-- 引入uniapp的SDK-->
	<script type="text/javascript" src="./js/uni.webview.1.5.4.js">
	</script>
	<!-- 引入vue方法-->
	<script src="./js/vue.js"></script>
	<script type="text/javascript" src="./js/upload.js"></script>
	<script type="text/javascript">
		
		function csfileed(){
			document.getElementById("tfile").click()
		}
		
		function getQueryVariable(variable) {
			var query = window.location.search.substring(1);
			var vars = query.split("&");
			for (var i = 0; i < vars.length; i++) {
				var pair = vars[i].split("=");
				if (pair[0] == variable) {
					return pair[1];
				}
			}
			return "";
		};
		
		const url = getQueryVariable("url")
		
		app.init(url)
		
		// 在引用依赖的文件后，需要在 HTML 中监听 UniAppJSBridgeReady 事件触发后，才能安全调用 uni 的 API。  
		document.addEventListener('UniAppJSBridgeReady', function() {
			uni.getEnv(function(res) {
				console.log('获取当前环境：' + JSON.stringify(res));
			});
		});
	</script>
</html>

